<style>
 #pageButton{
      width:80%;
      margin-left:10%;
     }
     #left{
      width:50%;
      
     }
     #right{
      width:50%;
      margin-left:50%;
      
     }
</style>
<nav class="navbar navbar-inverse" role="navigation">
   <div class="navbar-header">
      <a class="navbar-brand" href="../index.php">FishVideo</a>
   </div>
   <div>
      <ul class="nav navbar-nav">
         <?php
          require_once("../utils/db.php");
          $conn=connect();
          $realpath="video/upload/";    
          $sql="select * from fishvideo_videotype limit 0,4";
          $result=mysql_query($sql);
          while($trow=mysql_fetch_array($result)){
            echo "<li><a href='typedet.php?tid={$trow['yjl_tid']}'>
              {$trow['yjl_typename']}</a></li>";
          }
          mysql_close($conn);
        ?>
      </ul>
   </div>
     <form  action="typedet.php" class="navbar-form navbar-left" role="search" method="POST">
        <div class="form-group">
          <input type="text" class="form-control"  name="videoname" placeholder="搜索">
        </div>
        <button type="submit" name='search' class="btn btn-default">搜索</button>
      </form>
    <ul class="nav navbar-nav navbar-right">
           <?php
			session_start();
			if(isset($_SESSION['username'])){
			  echo "<li><a href='#' ><span class='glyphicon glyphicon-user'></span>{$_SESSION['username']}</a></li>";
			  echo " <li><a href='../user/user_exit.php'><span class='glyphicon glyphicon-off'></span>注销</a></li>";
			}else{
			  echo " <li><a href='#' data-toggle='modal'  data-target='#login'>登陆</a></li>";
			  echo " <li><a href='#' data-toggle='modal'  data-target='#register'>注册</a></li>";
			}
		?>    
			<li><a>&nbsp&nbsp&nbsp&nbsp</a></li>
     </ul>

     <!-- 模态框（Modal）（登陆） -->
<div class="modal fade" id="login" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
     <div class="modal-dialog">
      <div class="modal-content">
       <div class="modal-header">
        <button type="button" class="close" 
           data-dismiss="modal" aria-hidden="true">
            &times;
        </button>
        <h4 class="modal-title" id="myModalLabel">
           登陆
        </h4>
       </div>
       <!--登陆主体 -->
       <div class="modal-body">
         <form action="../user/doUserLogin.php" method="POST" role="form" >
        <table class="table">
          <tr>
            <th>用户名:</th><td><input type="text" name="user" 
            class="form-control" 
            placeholder="user"></td>
          </tr>
          <tr>
            <th>密码:</th><td><input type="password" name="pwd" 
            class="form-control"
            placeholder="password"></td>
          </tr>
        </table>
        <input type="submit" name="sub" class="btn-block btn-lg btn-primary" value="登陆">
      </form>
       </div>
      </div><!-- /.modal-content -->
  </div><!-- /.modal -->
</div>

<!-- 模态框（Modal）（注册） -->
<div class="modal fade" id="register" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
     <div class="modal-dialog">
      <div class="modal-content">
       <div class="modal-header">
        <button type="button" class="close" 
           data-dismiss="modal" aria-hidden="true">
            &times;
        </button>
        <h4 class="modal-title" id="myModalLabel">
           请填写注册信息
        </h4>
       </div>
       <!--登陆主体 -->
       <div class="modal-body">
    <form role="form" action="../user/doReg.php" method="post" enctype="multipart/form-data">
    <table class="table" align="center">
    <tr><th>姓名</th><td><input type="text" class="form-control" id="name" name="name"
    required oninvalid="setCustomValidity('请填写姓名')"
          oninput="setCustomValidity('')"></td></tr>
      <tr>
        <th>
         创建密码：
        </th>
        <td>
          <input type="password" name="pwd" id="pwd" class="form-control" placeholder="password" required oninvalid="setCustomValidity('请填写密码')"
          oninput="setCustomValidity('')">
        </td>
      </tr>
      <tr>
        <th>
         确认密码：
        </th>
        <td>
          <input type="password" name="rpwd" id="rpwd" class="form-control" required="required" placeholder="password"
          onblur="test()" required oninvalid="setCustomValidity('请再次填写密码')"
          oninput="setCustomValidity('')">
        </td>
        <td>
          <p id="clogodiv">
            
          </p>
        </td>
      </tr>
    <tr><th>性别</th>
    <td colspan="2">
    <input type="radio"  name="sex" value="0"checked>男
    <input type="radio"  name="sex" value="1">女</td></tr>
    <tr><th>生日</th><td><input type="date" id="bir" name="bir" class="form-control"></td></tr>
    <tr><th>爱好</th>
    <td colspan="5">
    <input type="checkbox" name="like[]" checked value="旅游">旅游</radio>
    <input type="checkbox" name="like[]" value="登山">登山</radio>
    <input type="checkbox" name="like[]" value="健身">健身</radio>
    <input type="checkbox" name="like[]" value="上网">上网</radio>
    <input type="checkbox" name="like[]" value="游泳">游泳</radio>
    </td></tr>
    <tr>
    <th>学历</th>
    <td>
    <select name="xl" class="form-control" required oninvalid="setCustomValidity('请选择学历')"
          oninput="setCustomValidity('')">
      <option  disabled selected>请选择</option>
      <option value ="0" >高中</option>
      <option value ="1">大学</option>
      <option value="2">研究生</option>
      <option value="3">博士</option>
    </select>
    </td>
    </tr>
    <tr>
    <th>自我介绍</th><td><textarea name="zwjs" class="form-control" rows="3" cols="20"
    placeholder="性格，习惯...."></textarea></td>
    </tr>
    <tr>
    <th>头像</th><td><input type="file" name="tx" class="form-control" ></td>
    </tr>
  </table>
  <div id="pageButton">
    <span id="left">
    <button type="button" class="btn btn-default" 
               data-dismiss="modal">关闭
            </button>
    </span>
    <span id="right">
            <button type="submit" class="btn btn-primary">
               注册
            </button>
    </span>
    </div>
   </form>
   </div>
  </div><!-- /.modal-content -->
  </div><!-- /.modal -->
</nav>